#ifndef XMLSCRIBE_H
#define XMLSCRIBE_H

#include <QDomDocument>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QFile>
#include <QMessageBox>
#include <QObject>
#include "../FileView/UpdateFile.h"
/*#include <QHash>
#include <QIcon>
#include <QTreeWidget>*/
 
class xmlScribe : public QObject
{
	Q_OBJECT
	
public:
	xmlScribe();
	virtual ~xmlScribe();

	void ReadFile(QString PathToRead);
	int WriteFile(QList<UpdateFile*> ListXML, QString PathToWrite);
	void Set_Path_Updater(QString NewVal);
signals:
	void StatusAutoUpdate(bool AutoUpdateEnabled, QString NewSha1, QString NewPath, QString NewFileName);
	void TasktoAddFileIntoTree(QString Sha1, QString Path, QString FileName, int priority);
private slots:
	void Debug_StatusAutoUpdate(bool AutoUpdateEnabled, QString NewSha1, QString NewPath, QString NewFileName);
	void Debug_StatusNewFile(QString Sha1, QString Path, QString FileName, int priority);
private:
	bool read(QIODevice *device);
	void parseMeElement(const QDomElement &element);
	void parseFileElement(const QDomElement &element);
	QString Path_Updater;
	QDomDocument domDocument;
};

#endif // XMLSCRIBE_H
